Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix concurrent write panic on watch #473

Closed
wants to merge 1 commit into from
Closed

Conversation

grindlemire
Copy link

This fixes a panic where the watch command would fail due to a concurrent write on the hashes variable. There are also a few reformatting fixes my linter automatically put in.

fatal error: concurrent map writes

goroutine 9 [running]:
github.com/a-h/templ/cmd/templ/generatecmd.generate({0x9d6f00, 0xc000024460}, {0xc00002a380, 0x3e}, {0xc000038930, 0x63}, 0xc00017b890, 0x0, {0xc00003f070, 0x2, ...})
        /home/grindlemire/go/pkg/mod/github.com/a-h/templ@v0.2.543/cmd/templ/generatecmd/main.go:414 +0x665
github.com/a-h/templ/cmd/templ/generatecmd.processSingleFile({0x9d6f00, 0xc000024460}, {0x9d1200, 0xc000066030}, {0xc00002a380, 0x3e}, {0xc000038930, 0x63}, 0x0?, 0x0, ...)
        /home/grindlemire/go/pkg/mod/github.com/a-h/templ@v0.2.543/cmd/templ/generatecmd/main.go:349 +0x106
github.com/a-h/templ/cmd/templ/generatecmd.processChanges.func1.1()
        /home/grindlemire/go/pkg/mod/github.com/a-h/templ@v0.2.543/cmd/templ/generatecmd/main.go:311 +0xf4
created by github.com/a-h/templ/cmd/templ/generatecmd.processChanges.func1 in goroutine 1
        /home/grindlemire/go/pkg/mod/github.com/a-h/templ@v0.2.543/cmd/templ/generatecmd/main.go:309 +0x77e

@a-h
Copy link
Owner

a-h commented Jan 29, 2024

Thanks for your work on this, but it's unfortunately superseded by #470 which introduces an fsnotify-based event handling design.

@a-h a-h closed this Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants